package clickhousedemo;

import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.PreparedStatementCreator;
import org.springframework.jdbc.core.PreparedStatementCreatorFactory;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.core.namedparam.ParsedSql;
import org.springframework.jdbc.core.namedparam.SqlParameterSource;

import javax.sql.DataSource;
import java.util.function.Consumer;

public class ChJdbcTemplate extends NamedParameterJdbcTemplate {
    public ChJdbcTemplate(DataSource dataSource) {
        super(dataSource);
    }

    public ChJdbcTemplate(JdbcOperations classicJdbcTemplate) {
        super(classicJdbcTemplate);
    }

    @Override
    public PreparedStatementCreator getPreparedStatementCreator(String sql, SqlParameterSource paramSource) {
        return super.getPreparedStatementCreator(sql, paramSource);
    }

    @Override
    protected PreparedStatementCreator getPreparedStatementCreator(String sql, SqlParameterSource paramSource, Consumer<PreparedStatementCreatorFactory> customizer) {
        return super.getPreparedStatementCreator(sql, paramSource, customizer);
    }

    @Override
    protected ParsedSql getParsedSql(String sql) {
        return super.getParsedSql(sql);
    }

    @Override
    protected PreparedStatementCreatorFactory getPreparedStatementCreatorFactory(ParsedSql parsedSql, SqlParameterSource paramSource) {
        return super.getPreparedStatementCreatorFactory(parsedSql, paramSource);
    }
}
